using System;
using System.Collections.Generic;

namespace Project3D.my3D.Structure
{

    public class myHalfedge
    {
        //Extra variable. Useful in algorithms for storing any information.
        public int e_id;

        //Link to the source vertex of this halfedge. 
        public myVertex source;

        //Link to the face to which this halfedge belongs.
        public myFace adjacent_face;

        //Link to the next halfedge in this face.
        public myHalfedge next;

        //Link to the previous halfedge in this face.
        public myHalfedge prev;

        //Link to the twin halfedge. Set to null if this halfedge on the boundary.
        public myHalfedge twin;

        public int flag;

        public myHalfedge()
        {
            e_id = 0;
            source = null;
            adjacent_face = null;
            next = null;
            prev = null;
            twin = null;
        }

        public myVertex target
        {
            get
            {
                if (this.next != null)
                    return this.next.source;
                else
                    return null;
            }
        }

        public myHalfedge Copy()
        {
            myHalfedge tmp = new myHalfedge();
            tmp.e_id = this.e_id;

            return tmp;
        }
    }

}
